﻿using System.ComponentModel.DataAnnotations;

namespace WH.Contracts.Systems.Menus
{
    /// <summary>
    /// 菜单
    /// </summary>
    public class MenuInputDto
    {
        /// <summary>
        /// 主键fid
        /// </summary>
        public string? Id { get; set; }


        /// <summary>
        /// 组件路径
        /// </summary>
        //[Required(ErrorMessage = "组件路径不能为空")]
        [MaxLength(255, ErrorMessage = "组件路径最大长度为255")]
        public string? Component { get; set; }

        /// <summary>
        /// 组件名称
        /// </summary>
        //[Required(ErrorMessage = "组件名称不能为空")]
        [MaxLength(255, ErrorMessage = "组件名称最大长度为255")]
        public string? ComponentName { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [MaxLength(255, ErrorMessage = "组件描述最大长度为255")]
        public string? Description { get; set; }

        /// <summary>
        /// 是否隐藏
        /// </summary>
        public bool Hidden { get; set; }

        /// <summary>
        /// 图标地址 此处以layui举例：layui-icon-set
        /// </summary>           
        //[Required(ErrorMessage = "组件路径不能为空")]
        [MaxLength(255, ErrorMessage = "图标最大长度为255")]
        public string? Icon { get; set; }


        /// <summary>
        /// 是否缓存
        /// </summary>
        public bool KeepAlive { get; set; }

        /// <summary>
        /// 菜单类型
        /// </summary>
        public int? MenuType { get; set; }

        /// <summary>
        /// 名称 例如：系统设置
        /// </summary>           
        [Required(ErrorMessage = "菜单名称不能为空")]
        [MaxLength(50, ErrorMessage = "菜单名称最大长度为50")]
        public string Name { get; set; } = null!;

        /// <summary>
        /// 父节点id 默认为0位顶节点
        /// </summary>      
        [Required(ErrorMessage = "父节点id不能为空")]
        [MaxLength(50, ErrorMessage = "父节点Id最大长度为50")]
        public string ParentId { get; set; } = null!;


        /// <summary>
        /// 
        /// </summary>      
        [MaxLength(255, ErrorMessage = "最大长度为255")]
        public string? Perms { get; set; }

        /// <summary>
        /// 
        /// </summary>      
        [MaxLength(255, ErrorMessage = "最大长度为255")]
        public string? PermsType { get; set; }

        /// <summary>
        /// 跳转地址
        /// </summary>      
        [MaxLength(255, ErrorMessage = "跳转地址最大长度为255")]
        public string? Redirect { get; set; }

        /// <summary>
        /// 路由组件
        /// </summary>      
        public bool Route { get; set; }

        /// <summary>
        /// 排序
        /// </summary>      
        public int SortNo { get; set; }

        /// <summary>
        /// 状态
        /// </summary>      
        public bool Status { get; set; }


        /// <summary>
        /// 访问路径
        /// </summary>      
        [MaxLength(255, ErrorMessage = "访问路径最大长度为255")]
        public string? Url { get; set; }

        /// <summary>
        /// 打开方式
        /// </summary>      
        public bool? InternalOrExternal { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public string? CreatedBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string? UpdatedBy { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdatedTime { get; set; }
    }
}
